package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingPlanPageDto;
import com.zzyl.entity.NursingPlan;
import com.zzyl.entity.ProjectPlans;
import com.zzyl.vo.CountVo;
import com.zzyl.vo.NursingPlanProjectVo;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingPlanMapper {

    List<NursingPlanVo> findAll();

    @Options(useGeneratedKeys = true , keyProperty = "id" , keyColumn = "id")
    @Insert("INSERT INTO `nursing_plan` (\n" +
            "        `sort_no`, \n" +
            "        `plan_name`, \n" +
            "        `status`, \n" +
            "        `create_time`, \n" +
            "        `update_time`, \n" +
            "        `create_by`, \n" +
            "        `update_by`, \n" +
            "        `remark`\n" +
            "    ) VALUES (\n" +
            "        #{sortNo}, \n" +
            "        #{planName}, \n" +
            "        #{status}, \n" +
            "        #{createTime}, \n" +
            "        #{updateTime}, \n" +
            "        #{createBy}, \n" +
            "        #{updateBy}, \n" +
            "        #{remark}\n" +
            "    );")
    void insert(NursingPlan nursingPlan);

    void insertProjectPlans(List<ProjectPlans> projectPlansList);

    Page<NursingPlanVo> findPage(NursingPlanPageDto nursingPlanPageDto);

    NursingPlanProjectVo findById(Long id);

    void update(NursingPlan nursingPlan);

    void deleteProjectPlans(Long id);

    void deleteById(Long id);


    void updateStatus(Long id, Integer status);
}
